package com.chapter14;

//具体的观察者
public class ConcretObserver extends Observer{
    private String name;
    private String observerState;
    private ConcretSubject subject;

    public ConcretObserver(ConcretSubject subject, String name){
        this.name = name;
        this.subject = subject;
    }


    @Override
    public void Update() {
        this.observerState = subject.getSubjectState();
        System.out.println("观察者"+name+"的新状态为"+observerState);
    }
}
